/*
 * cache.h
 *
 *  Created on: Oct 12, 2011
 *      Author: welcome
 */

#ifndef CACHE_H_
#define CACHE_H_

#include <rdesktop.h>

#ifdef __cplusplus
extern "C" {
#endif

extern void cache_rebuild_bmpcache_linked_list(uint8 id, sint16 * idx,
		int count);
extern void cache_bump_bitmap(uint8 id, uint16 idx, int bump);
extern void cache_evict_bitmap(uint8 id);
extern RD_HBITMAP cache_get_bitmap(uint8 id, uint16 idx);
extern void cache_put_bitmap(uint8 id, uint16 idx, RD_HBITMAP bitmap);
extern void cache_save_state(void);
extern FONTGLYPH *cache_get_font(uint8 font, uint16 character);
extern void cache_put_font(uint8 font, uint16 character, uint16 offset,
		uint16 baseline, uint16 width, uint16 height, RD_HGLYPH pixmap);
extern DATABLOB *cache_get_text(uint8 cache_id);
extern void cache_put_text(uint8 cache_id, void *data, int length);
extern uint8 *cache_get_desktop(uint32 offset, int cx, int cy,
		int bytes_per_pixel);
extern void cache_put_desktop(uint32 offset, int cx, int cy, int scanline,
		int bytes_per_pixel, uint8 * data);
extern RD_HCURSOR cache_get_cursor(uint16 cache_idx);
extern void cache_put_cursor(uint16 cache_idx, RD_HCURSOR cursor);
extern BRUSHDATA *cache_get_brush_data(uint8 colour_code, uint8 idx);
extern void cache_put_brush_data(uint8 colour_code, uint8 idx,
		BRUSHDATA * brush_data);
#ifdef __cplusplus
}
#endif
#endif /* CACHE_H_ */
